class Solution:
    def findComplement(self, num: 'int') -> 'int':
        binstr = bin(num)
        newstr = '0b'
        for i in range(2, len(binstr)):
            newstr += '0' if binstr[i] == '1' else '1'
        return int(newstr, 2)

s = Solution()
print(s.findComplement(5))